Skip to content

Peephole optimizations#774

Draft
ZERICO2005 wants to merge 4 commits intomasterfrom
peephole_opt
Draft

Peephole optimizations#774
ZERICO2005 wants to merge 4 commits intomasterfrom
peephole_opt

Conversation

@ZERICO2005
Copy link
Copy Markdown
Contributor

collection of unrelated assembly peephole optimizations

pop de
pop de
pop de
ld sp, ix
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wouldn't exactly a peephole optimization, but you could entirely remove this.

Suggested change
ld sp, ix

call usb_GetDeviceEndpoint
pop de
pop de
ld sp, ix
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wouldn't exactly a peephole optimization, but you could entirely remove this.

Suggested change
ld sp, ix

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized we can also call .line_coding here to save another byte

Copy link
Copy Markdown
Contributor Author

@ZERICO2005 ZERICO2005 Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although to be fair. If we need to save bytes we would just rewrite that whole function in assembly lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants